/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.DesignPatterns.structural.adapter;

/**
 *
 * @author Nashief
 */
public class TempretureObjectReporter implements TempretureInfo {

   
    CelciusReporter celciusReporter;

    public TempretureObjectReporter(CelciusReporter celciusReporter) {
        this.celciusReporter = celciusReporter;
    }

    public TempretureObjectReporter() {
    }
    
    
    
    @Override
    public double getTempretureInf() {
        return cToF(celciusReporter.getTemperatureInc());
    }

    @Override
    public void setTempretureInf(double tempretureInf) {
        celciusReporter.setTemperatureInc(fToC(tempretureInf));
    }

    @Override
    public double getTempretureInc() {
        return celciusReporter.getTemperatureInc();
    }

    @Override
    public void setTempretureInc(double tempretureInc) {
        celciusReporter.setTemperatureInc(tempretureInc);
    } 
    private double fToC(double f){
    return ((f-32)*5/9);
    }
    private double cToF(double c){
    return ((c*9/5)+32);
    }
    
}
